<?php
/*
YHM (Your Hosting Manager) - Copyright 2010 All Rights Reserved. - YHM Group
Released under the Simplified BSD Licence.

Website: http://yhm.co.uk
Licence: http://yhm.co.uk/about/#licence

file: global.php
author: Kieran D. (Polarbear541)
*/

define("ROOT", dirname(__FILE__));

//Connect to DB
if (file_exists(ROOT . "/includes/config.php"))
{	
	require_once(ROOT . "/includes/config.php");
	mysql_connect("$db_host", "$db_user", "$db_pass")or die("<font face='sans-serif'>Cannot connect to host, make sure host name is correct.</font>");
	mysql_select_db("$db_name")or die("<font face='sans-serif'>Cannot connect to database, make sure database name is correct.</font>");
	define("TABLE_PREFIX", $prefix);
}
else
{
	header("location: ./install/");
	die ("<font face='sans-serif'>YHM has not been installed. Please run the installer by browsing to the install directory.</font>");
}

//Check if Lock exists
if (!file_exists(ROOT . "/install/lock"))
{
	die ("The Installer is not Locked! Please create an empty file named 'lock' then refresh.");
}

//Include Functions
require_once(ROOT . "/includes/functions.php");

//Include Charlie's Amazing Settings System :P
require_once(ROOT . "/includes/settings.php");
?>